package com.yuhs.zixing.study.multithread.mashibing.t001base.t003.start;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * Function: 启动线程 4
 *
 * @Author yuhongsheng
 * @Date: 2023-12-18 21:18:04
 */
@Slf4j
public class ThreadStart004 implements Callable<String> {

    public static void main(String[] args) {
        new Thread(new FutureTask<String>(new ThreadStart004())).start();
    }

    /**
     * Computes a result, or throws an exception if unable to do so.
     *
     * @return computed result
     * @throws Exception if unable to compute a result
     */
    @Override
    public String call() throws Exception {
        log.atInfo().log("Callable  创建线程 并启动");
        return "call";
    }
}
